import React, { Component } from 'react';
import '../css/Creater.less';
import {observer} from "mobx-react";
import  Mobx from  '../mobx'
@observer class Creater extends Component {
    constructor(props) {
        super(props)
    }
    toDetail(item){
        Mobx.history.push('/Detail/'+item.creativity.id)
    }
    render() {
        return (
            <div className="Creater">
                <div className='creativeRecommendation'>
                    {
                        this.props.Creates.map((item,index)=>{
                            return(
                                <div className='creativeSonRecommendation'  key= {index} onClick={this.toDetail.bind(this,item)}>
                                    <div>
                                        <img src={item.creativity.indexImage} alt=""/>
                                    </div>
                                    <p className='shengluehao'>{item.creativity.titleName}</p>
                                    <p className='caozuo'>
                                        <span><img src={require('../img/eye.png')} alt=""/>{item.creativity.browseCount}</span>
                                        <span><img src={require('../img/zan.png')} alt=""/>{item.creativity.likeCount}</span>
                                        <i className='right'>
                                            <img src={require('../img/tuijian.png')} alt=""/>
                                        </i>
                                    </p>
                                </div>
                            )
                        })
                    }
                </div>
            </div>
        );
    }
}

export default Creater;
